﻿#pragma once
#include <shlwapi.h>
#pragma  comment(lib, "Shlwapi.lib")

//@模块名称  windows-API
//@版本  1.0  
//@日期  2020-11-23
//@作者  XCGUI  
//@模块备注  windows-API


/*@声明
//@分组{   路径操作
//@别名  路径_组合()
wchar_t* PathCombine(wchar_t*  pszDest, const wchar_t* pszDir, const wchar_t* pszFile);

//@别名 路径_到相对路径(文件路径)
//@返回 如果成功返回TRUE，否则返回false
BOOL PathRelativePathTo(wchar_t*  pszPath, const wchar_t* pszFrom, DWORD dwAttrFrom, const wchar_t* pszTo, DWORD dwAttrTo);

//@参数 pszPath 文件路径,指向以0结尾，最大长度为MAX_PATH文件路径字符串指针。
//@别名 路径_查找文件扩展名(文件路径)
//@返回 如果扩展名找到则返回pszPath字符串中“.”所在地址，否则返回空字符结尾地址。
//@备注 一个有效的扩展名是不包括空格的。
const wchar_t* PathFindExtension(const wchar_t* pszPath);

//@参数 pszPath 文件路径,
//@别名 路径_移除文件扩展名(文件路径)
//@返回 移除后的文件路径,不包含扩展名
void PathRemoveExtension(wchar_t* pszPath);

//@参数 pszPath 文件路径,
//@别名 路径_查找文件名(文件路径)
//@返回 函数返回指向文件名的指针（如果找到的话），否则返回指向路径开头的指针。
const wchar_t* PathFindFileName(const wchar_t* pszPath);

//@参数 pszPath 文件路径,
//@别名 路径_判断文件是否存在(文件路径)
//@返回 如果该文件存在返回TRUE，否则返回false
BOOL PathFileExists(const wchar_t* pszPath);

//@参数 pszPath 文件路径,指向长度为MAX_PATH的空终止字符串的指针，该字符串包含要从中删除文件名的路径。
//@别名 路径_移除末尾的文件夹名和反斜杠(文件路径)
//@返回 如果已删除某些内容，则返回非零值；否则返回零。
BOOL PathRemoveFileSpec(wchar_t* pszPath);
//@分组}
*/

/*@声明
//@分组{   窗口管理

BOOL CloseWindow(
  HWND hWnd
);
HWND CreateWindow( LPCTSTR lpClassName,
    LPCTSTR lpWindowName,
    DWORD dwStyle,
    int x,
    int y,
    int nWidth,
    int nHeight,
    HWND hWndParent,
    HMENU hMenu,
    HINSTANCE hInstance,
    LPVOID lpParam
);

HWND CreateWindowEx(
  DWORD     dwExStyle,
  LPCWSTR   lpClassName,
  LPCWSTR   lpWindowName,
  DWORD     dwStyle,
  int       X,
  int       Y,
  int       nWidth,
  int       nHeight,
  HWND      hWndParent,
  HMENU     hMenu,
  HINSTANCE hInstance,
  LPVOID    lpParam
);

HDWP DeferWindowPos(
  HDWP hWinPosInfo,
  HWND hWnd,
  HWND hWndInsertAfter,
  int  x,
  int  y,
  int  cx,
  int  cy,
  UINT uFlags
);
HDWP BeginDeferWindowPos(
  int nNumWindows
);
BOOL EndDeferWindowPos(
  HDWP hWinPosInfo
);
BOOL DestroyWindow(
  HWND hWnd
);
LRESULT DefWindowProc(
  HWND   hWnd,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);

LRESULT DispatchMessage(
  const MSG *lpMsg
);

BOOL EnumChildWindows(
  HWND        hWndParent,
  WNDENUMPROC lpEnumFunc,
  LPARAM      lParam
);

HWND FindWindow(
  LPCWSTR lpClassName,
  LPCWSTR lpWindowName
);
HWND FindWindowEx(
  HWND    hWndParent,
  HWND    hWndChildAfter,
  LPCWSTR lpszClass,
  LPCWSTR lpszWindow
);
BOOL GetClassInfo(
  HINSTANCE   hInstance,
  LPCWSTR     lpClassName,
  LPWNDCLASSW lpWndClass
);
DWORD GetClassLong(
  HWND hWnd,
  int  nIndex
);
int GetClassName(
  HWND   hWnd,
  LPTSTR lpClassName,
  int    nMaxCount
);
HWND GetDesktopWindow();

HWND GetForegroundWindow();

BOOL GetGUIThreadInfo(
  DWORD          idThread,
  PGUITHREADINFO pgui
);
BOOL GetInputState();
BOOL GetMessage(
  LPMSG lpMsg,
  HWND  hWnd,
  UINT  wMsgFilterMin,
  UINT  wMsgFilterMax
);

HWND GetNextWindow(HWND hWnd,
    UINT wCmd
);
HWND GetTopWindow(
  HWND hWnd
);
HWND GetWindow(
  HWND hWnd,
  UINT uCmd
);

HWND GetParent(
  HWND hWnd
);

HWND GetShellWindow();
int GetSystemMetrics(
  int nIndex
);
LONG GetWindowLong(
  HWND hWnd,
  int  nIndex
);

LONG_PTR GetWindowLongPtr(
  HWND hWnd,
  int  nIndex
);
UINT GetWindowModuleFileName(
  HWND   hwnd,
  LPWSTR pszFileName,
  UINT   cchFileNameMax
);
BOOL GetWindowPlacement(
  HWND            hWnd,
  WINDOWPLACEMENT *lpwndpl
);

int GetWindowText(
  HWND   hWnd,
  LPWSTR lpString,
  int    nMaxCount
);

int GetWindowTextLength(
  HWND hWnd
);
DWORD GetWindowThreadProcessId(
  HWND    hWnd,
  LPDWORD lpdwProcessId
);

BOOL IsChild(
  HWND hWndParent,
  HWND hWnd
);

BOOL IsGUIThread(
  BOOL bConvert
);
BOOL IsIconic(
  HWND hWnd
);
BOOL IsZoomed(
  HWND hWnd
);
BOOL IsWindow(
  HWND hWnd
);

BOOL IsWindowUnicode(
  HWND hWnd
);
BOOL IsWindowVisible(
  HWND hWnd
);
BOOL KillTimer(
  HWND     hWnd,
  UINT_PTR uIDEvent
);

BOOL LockSetForegroundWindow(
  UINT uLockCode
);
BOOL LogicalToPhysicalPoint(
  HWND    hWnd,
  LPPOINT lpPoint
);
BOOL MoveWindow(
  HWND hWnd,
  int  X,
  int  Y,
  int  nWidth,
  int  nHeight,
  BOOL bRepaint
);
BOOL PeekMessage(
  LPMSG lpMsg,
  HWND  hWnd,
  UINT  wMsgFilterMin,
  UINT  wMsgFilterMax,
  UINT  wRemoveMsg
);
LRESULT SendMessage(
  HWND   hWnd,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);
BOOL PostMessage(
  HWND   hWnd,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);
void PostQuitMessage(
  int nExitCode
);
BOOL PostThreadMessage(
  DWORD  idThread,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);
HWND RealChildWindowFromPoint(
  HWND  hwndParent,
  POINT ptParentClientCoords
);
UINT RealGetWindowClass(
  HWND   hwnd,
  LPWSTR ptszClassName,
  UINT   cchClassNameMax
);
ATOM RegisterClass(
  const WNDCLASSW *lpWndClass
);
ATOM RegisterClassEx(
  const WNDCLASSEXW *Arg1
);

BOOL SendMessageCallback(
  HWND          hWnd,
  UINT          Msg,
  WPARAM        wParam,
  LPARAM        lParam,
  SENDASYNCPROC lpResultCallBack,
  ULONG_PTR     dwData
);
LRESULT SendMessageTimeout(
  HWND       hWnd,
  UINT       Msg,
  WPARAM     wParam,
  LPARAM     lParam,
  UINT       fuFlags,
  UINT       uTimeout,
  PDWORD_PTR lpdwResult
);
BOOL SendNotifyMessage(
  HWND   hWnd,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);
DWORD SetClassLong(
  HWND hWnd,
  int  nIndex,
  LONG dwNewLong
);
ULONG_PTR SetClassLongPtr(
  HWND     hWnd,
  int      nIndex,
  LONG_PTR dwNewLong
);

BOOL SetForegroundWindow(
  HWND hWnd
);
BOOL SetLayeredWindowAttributes(
  HWND     hwnd,
  COLORREF crKey,
  BYTE     bAlpha,
  DWORD    dwFlags
);

HWND SetParent(
  HWND hWndChild,
  HWND hWndNewParent
);

UINT_PTR SetTimer(
  HWND      hWnd,
  UINT_PTR  nIDEvent,
  UINT      uElapse,
  TIMERPROC lpTimerFunc
);

LONG_PTR SetWindowLongPtr(
  HWND     hWnd,
  int      nIndex,
  LONG_PTR dwNewLong
);

LONG SetWindowLong(
  HWND hWnd,
  int  nIndex,
  LONG dwNewLong
);

BOOL SetWindowPlacement(
  HWND                  hWnd,
  const WINDOWPLACEMENT *lpwndpl
);

BOOL SetWindowPos(
  HWND hWnd,
  HWND hWndInsertAfter,
  int  X,
  int  Y,
  int  cx,
  int  cy,
  UINT uFlags
);
HHOOK SetWindowsHookEx(
  int       idHook,
  HOOKPROC  lpfn,
  HINSTANCE hmod,
  DWORD     dwThreadId
);

BOOL SetWindowText(
  HWND    hWnd,
  LPCWSTR lpString
);

BOOL ShowOwnedPopups(
  HWND hWnd,
  BOOL fShow
);
BOOL ShowWindow(
  HWND hWnd,
  int  nCmdShow
);
BOOL ShowWindowAsync(
  HWND hWnd,
  int  nCmdShow
);
WORD TileWindows(
  HWND       hwndParent,
  UINT       wHow,
  const RECT *lpRect,
  UINT       cKids,
  const HWND *lpKids
);
BOOL TranslateMessage(
  const MSG *lpMsg
);

BOOL UnhookWindowsHookEx(
  HHOOK hhk
);
BOOL UnregisterClass(
  LPCWSTR   lpClassName,
  HINSTANCE hInstance
);

BOOL UpdateLayeredWindow(
  HWND          hWnd,
  HDC           hdcDst,
  POINT         *pptDst,
  SIZE          *psize,
  HDC           hdcSrc,
  POINT         *pptSrc,
  COLORREF      crKey,
  BLENDFUNCTION *pblend,
  DWORD         dwFlags
);

BOOL WaitMessage();
HWND WindowFromPoint(
  POINT Point
);

BOOL CloseHandle(
  HANDLE hObject
);
//@分组}
*/

//------------坐标操作--------------------------------------------------------------------------------------------
/*@声明
//@分组{   坐标

BOOL GetWindowRect( HWND hWnd,   LPRECT lpRect);

BOOL GetClientRect( HWND   hWnd, LPRECT lpRect);

BOOL ClientToScreen(  HWND hWnd, 
  LPPOINT lpPoint);
 
BOOL ScreenToClient(  HWND hWnd, 
  LPPOINT lpPoint );
  
BOOL PtInRect(  const RECT *lprc,  POINT pt);
//@分组}
*/

//-------------文件管理------------------------------------------------------------------------------------------------
/*@声明
//@分组{  文件管理

HANDLE WINAPI CreateFile(
  __in          LPCTSTR lpFileName,
  __in          DWORD dwDesiredAccess,
  __in          DWORD dwShareMode,
  __in          LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  __in          DWORD dwCreationDisposition,
  __in          DWORD dwFlagsAndAttributes,
  __in          HANDLE hTemplateFile
);

BOOL WINAPI CopyFile(
  __in          LPCTSTR lpExistingFileName,
  __in          LPCTSTR lpNewFileName,
  __in          BOOL bFailIfExists
);
BOOL WINAPI DeleteFile(
  __in          LPCTSTR lpFileName
);
BOOL WINAPI FindClose(
  __in_out      HANDLE hFindFile
);
DWORD WINAPI GetFileSize(
  __in          HANDLE hFile,
  __out         LPDWORD lpFileSizeHigh
);
BOOL WINAPI GetFileSizeEx(
  __in          HANDLE hFile,
  __out         PLARGE_INTEGER lpFileSize
);
DWORD WINAPI GetFileType(
  __in          HANDLE hFile
);
BOOL WINAPI MoveFile(
  __in          LPCTSTR lpExistingFileName,
  __in          LPCTSTR lpNewFileName
);
BOOL WINAPI MoveFileEx(
  __in          LPCTSTR lpExistingFileName,
  __in          LPCTSTR lpNewFileName,
  __in          DWORD dwFlags
);
HFILE WINAPI OpenFile(
  __in          LPCSTR lpFileName,
  __out         LPOFSTRUCT lpReOpenBuff,
  __in          UINT uStyle
);
BOOL WINAPI LockFile(
  __in          HANDLE hFile,
  __in          DWORD dwFileOffsetLow,
  __in          DWORD dwFileOffsetHigh,
  __in          DWORD nNumberOfBytesToLockLow,
  __in          DWORD nNumberOfBytesToLockHigh
);
BOOL WINAPI LockFileEx(
  __in          HANDLE hFile,
  __in          DWORD dwFlags,
  DWORD dwReserved,
  __in          DWORD nNumberOfBytesToLockLow,
  __in          DWORD nNumberOfBytesToLockHigh,
  __in          LPOVERLAPPED lpOverlapped
);
BOOL WINAPI ReadFile(
  __in          HANDLE hFile,
  __out         LPVOID lpBuffer,
  __in          DWORD nNumberOfBytesToRead,
  __out         LPDWORD lpNumberOfBytesRead,
  __in          LPOVERLAPPED lpOverlapped
);

BOOL WINAPI ReadFileEx(
  __in          HANDLE hFile,
  __out         LPVOID lpBuffer,
  __in          DWORD nNumberOfBytesToRead,
  __in          LPOVERLAPPED lpOverlapped,
  __in          LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
BOOL WINAPI WriteFile(
  __in          HANDLE hFile,
  __in          LPCVOID lpBuffer,
  __in          DWORD nNumberOfBytesToWrite,
  __out         LPDWORD lpNumberOfBytesWritten,
  __in          LPOVERLAPPED lpOverlapped
);
BOOL WINAPI WriteFileEx(
  __in          HANDLE hFile,
  __in          LPCVOID lpBuffer,
  __in          DWORD nNumberOfBytesToWrite,
  __in          LPOVERLAPPED lpOverlapped,
  __in          LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
BOOL WINAPI UnlockFile(
  __in          HANDLE hFile,
  __in          DWORD dwFileOffsetLow,
  __in          DWORD dwFileOffsetHigh,
  __in          DWORD nNumberOfBytesToUnlockLow,
  __in          DWORD nNumberOfBytesToUnlockHigh
);
//@分组}
*/

//---------------模块管理----------------------------------------------------------------------------
/*@声明
//@分组{  动态库操作

//@参数 lpModuleName 模块名称, 指向含有模块名称字符串的指针；
//@别名 取模块名句柄(模块名称)
//@返回 如执行成功成功，则返回模块句柄。零表示失败
//@备注 只有欲获取的模块已映射到调用该函数的进程内，才会正确得到模块句柄。常用模块映射函数：LoadLibrary。
HMODULE GetModuleHandle(LPCWSTR lpModuleName);

//@参数 hModule 模块句柄,可以是一个DLL模块，或者是一个应用程序的实例句柄。如果该参数为NULL，该函数返回该应用程序全路径。
//@参数 lpFilename 路径名, 指定一个字串缓冲区，要在其中容纳文件的用NULL字符中止的路径名，hModule模块就是从这个文件装载进来的；
//@参数 nSize 大小,装载到缓冲区lpFileName的最大字符数量
//@别名 取模块文件路径(模块句柄,路径名,大小)
//@返回 如执行成功，返回复制到lpFileName的实际字符数量；零表示失败。使用GetLastError可以打印错误信息。
//@备注 获取当前进程已加载模块的文件的完整路径，该模块必须由当前进程加载。
DWORD GetModuleFileName(HMODULE hModule,LPWSTR lpFilename,DWORD nSize);

//@参数 dwFlags 标志
//@参数 lpModuleName 模块名称, 指向含有模块名称字符串的指针；
//@参数 phModule 句柄
//@别名 取模块名句柄Ex(模块名称)
//@返回 如执行成功成功，则返回真。零表示假
//@备注 只有欲获取的模块已映射到调用该函数的进程内，才会正确得到模块句柄。常用模块映射函数：LoadLibrary。
BOOL GetModuleHandleEx(DWORD dwFlags,LPCWSTR lpModuleName,HMODULE *phModule);

//@参数 hModule 模块句柄,包含此函数的DLL模块的句柄。LoadLibrary、AfxLoadLibrary 或者GetModuleHandle函数可以返回此句柄。
//@参数 lpProcName 函数名,包含函数名的以NULL结尾的字符串，或者指定函数的序数值。如果此参数是一个序数值，它必须在低字，高字必须为0。
//@别名 取函数地址(模块句柄,函数名)
//@返回 如果函数调用成功，返回值是DLL中的输出函数地址。失败，返回值是NULL
//@备注 载入指定的动态链接库，并将它映射到当前进程使用的地址空间。一旦载入，即可访问库内保存的资源
FARPROC GetProcAddress(HMODULE hModule,LPCSTR lpProcName);

//@参数 lpLibFileName 动态库名称, 指定要载入的动态链接库的名称
//@别名 动态库_载入(动态库名称)
//@返回 Long，非零表示成功，零表示失败。会设置GetLastError
//@备注 载入指定的动态链接库，并将它映射到当前进程使用的地址空间。一旦载入，即可访问库内保存的资源
HMODULE LoadLibrary(LPCWSTR lpLibFileName);

//@参数 lpLibFileName 动态库名称, 指定要载入的动态链接库的名称
//@参数 hFile 文件,未用, 设为零
//@参数 dwFlags 标志, 指定下述常数的一个或多个,详细MSDN
//@别名 动态库_载入Ex(动态库名称,文件,标志)
//@返回 Long，非零表示成功，零表示失败。会设置GetLastError
//@备注 载入指定的动态链接库，并将它映射到当前进程使用的地址空间。一旦载入，即可访问库内保存的资源
HMODULE LoadLibraryEx(LPCWSTR lpLibFileName,HANDLE hFile,DWORD dwFlags);

//@参数 hLibModule 库文件句柄, 要释放的动态链接库句柄
//@别名 动态库_释放(库文件句柄)
//@返回 Long，非零表示成功，零表示失败。会设置GetLastError
//@备注 释放指定的动态链接库，它们早先是用LoadLibrary API函数装载的
BOOL FreeLibrary(HMODULE hLibModule);

DLL_DIRECTORY_COOKIE AddDllDirectory(
  PCWSTR NewDirectory
);
BOOL RemoveDllDirectory(
  DLL_DIRECTORY_COOKIE Cookie
);

//@分组}
*/

//---------------内存管理--------------------------------------------------------------------------------------
/*@声明
//@分组{   内存管理

LPVOID WINAPI VirtualAlloc(
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD flAllocationType,
  __in          DWORD flProtect
);
LPVOID WINAPI VirtualAllocEx(
  __in          HANDLE hProcess,
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD flAllocationType,
  __in          DWORD flProtect
);

LPVOID WINAPI VirtualAllocExNuma(
  __in          HANDLE hProcess,
  __in_opt      LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD flAllocationType,
  __in          DWORD flProtect,
  __in          DWORD nndPreferred
);

BOOL WINAPI VirtualFree(
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD dwFreeType
);
BOOL WINAPI VirtualFreeEx(
  __in          HANDLE hProcess,
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD dwFreeType
);
BOOL WINAPI VirtualLock(
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize
);
BOOL WINAPI VirtualProtect(
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD flNewProtect,
  __out         PDWORD lpflOldProtect
);
BOOL WINAPI VirtualProtectEx(
  __in          HANDLE hProcess,
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize,
  __in          DWORD flNewProtect,
  __out         PDWORD lpflOldProtect
);
SIZE_T WINAPI VirtualQuery(
  __in          LPCVOID lpAddress,
  __out         PMEMORY_BASIC_INFORMATION lpBuffer,
  __in          SIZE_T dwLength
);
SIZE_T WINAPI VirtualQueryEx(
  __in          HANDLE hProcess,
  __in          LPCVOID lpAddress,
  __out         PMEMORY_BASIC_INFORMATION lpBuffer,
  __in          SIZE_T dwLength
);
BOOL WINAPI VirtualUnlock(
  __in          LPVOID lpAddress,
  __in          SIZE_T dwSize
);

HGLOBAL WINAPI GlobalAlloc(
  __in          UINT uFlags,
  __in          SIZE_T dwBytes
);
HGLOBAL WINAPI GlobalDiscard(
  __in                 HGLOBAL hMem
);
UINT WINAPI GlobalFlags(
  __in          HGLOBAL hMem
);
HGLOBAL WINAPI GlobalFree(
  __in          HGLOBAL hMem
);
HGLOBAL WINAPI GlobalHandle(
  __in          LPCVOID pMem
);
LPVOID WINAPI GlobalLock(
  __in          HGLOBAL hMem
);

HGLOBAL WINAPI GlobalReAlloc(
  __in          HGLOBAL hMem,
  __in          SIZE_T dwBytes,
  __in          UINT uFlags
);
SIZE_T WINAPI GlobalSize(
  __in          HGLOBAL hMem
);

BOOL WINAPI GlobalUnlock(
  __in          HGLOBAL hMem
);
HLOCAL WINAPI LocalAlloc(
  __in          UINT uFlags,
  __in          SIZE_T uBytes
);
HLOCAL WINAPI LocalDiscard(
 __in                HLOCAL hlocMem
);

UINT WINAPI LocalFlags(
  __in          HLOCAL hMem
);

HLOCAL WINAPI LocalFree(
  __in          HLOCAL hMem
);
HLOCAL WINAPI LocalHandle(
  __in          LPCVOID pMem
);
LPVOID WINAPI LocalLock(
  __in          HLOCAL hMem
);
HLOCAL WINAPI LocalReAlloc(
  __in          HLOCAL hMem,
  __in          SIZE_T uBytes,
  __in          UINT uFlags
);
UINT WINAPI LocalSize(
  __in          HLOCAL hMem
);
BOOL WINAPI LocalUnlock(
  __in          HLOCAL hMem
);

//@分组}
*/

//---------------资源管理--------------------------------------------------------------------------------------
/*@声明
//@分组{   资源管理


HRSRC FindResource(HMODULE hModule,
    LPCTSTR lpName,
    LPCTSTR lpType
);

HRSRC FindResourceEx(HMODULE hModule,
    LPCTSTR lpType,
    LPCTSTR lpName,
    WORD wLanguage
);
HGLOBAL LoadResource(HMODULE hModule,
    HRSRC hResInfo
);
LPVOID LockResource(HGLOBAL hResData
);

DWORD SizeofResource(HMODULE hModule,
    HRSRC hResInfo
);
BOOL FreeResource(HGLOBAL hglbResource
);
HANDLE LoadImage(HINSTANCE hinst,
    LPCTSTR lpszName,
    UINT uType,
    int cxDesired,
    int cyDesired,
    UINT fuLoad
);
//--------------插入符--------------------------------------
BOOL CreateCaret(          HWND hWnd,
    HBITMAP hBitmap,
    int nWidth,
    int nHeight
);
BOOL DestroyCaret();
UINT GetCaretBlinkTime();
BOOL GetCaretPos(LPPOINT lpPoint
);
BOOL HideCaret(HWND hWnd
);
BOOL SetCaretBlinkTime(UINT uMSeconds
);
BOOL SetCaretPos(int X,
    int Y
);
BOOL ShowCaret(HWND hWnd
);


//-----------光标---------------------------------
BOOL ClipCursor(          const RECT *lpRect
);
HCURSOR CopyCursor(          HCURSOR pcur
);
HCURSOR CreateCursor(          HINSTANCE hInst,
    int xHotSpot,
    int yHotSpot,
    int nWidth,
    int nHeight,
    const VOID *pvANDPlane,
    const VOID *pvXORPlane
);
BOOL DestroyCursor(          HCURSOR hCursor
);

BOOL GetClipCursor(          LPRECT lpRect
);
HCURSOR GetCursor();
BOOL GetCursorInfo(          PCURSORINFO pci
);
BOOL GetCursorPos(          LPPOINT lpPoint
);
BOOL GetPhysicalCursorPos(          LPPOINT lpPoint
);
HCURSOR LoadCursor(          HINSTANCE hInstance,
    LPCTSTR lpCursorName
);
HCURSOR LoadCursorFromFile(          LPCTSTR lpFileName
);
HCURSOR SetCursor(          HCURSOR hCursor
);
BOOL SetCursorPos(          int X,
    int Y
);
BOOL SetPhysicalCursorPos(          int X,
    int Y
);
BOOL SetSystemCursor(          HCURSOR hcur,
    DWORD id
);
int ShowCursor(          BOOL bShow
);

//-----------ICON 图标--------------------------------------

HICON CopyIcon(          HICON hIcon
);
HICON CreateIcon(          HINSTANCE hInstance,
    int nWidth,
    int nHeight,
    BYTE cPlanes,
    BYTE cBitsPixel,
    const BYTE *lpbANDbits,
    const BYTE *lpbXORbits
);
HICON CreateIconFromResource(          PBYTE presbits,
    DWORD dwResSize,
    BOOL fIcon,
    DWORD dwVer
);
HICON CreateIconFromResourceEx(          PBYTE pbIconBits,
    DWORD cbIconBits,
    BOOL fIcon,
    DWORD dwVersion,
    int cxDesired,
    int cyDesired,
    UINT uFlags
);
HICON CreateIconIndirect(          PICONINFO piconinfo
);
BOOL DestroyIcon(          HICON hIcon
);
BOOL DrawIcon(          HDC hDC,
    int X,
    int Y,
    HICON hIcon
);
BOOL DrawIconEx(          HDC hdc,
    int xLeft,
    int yTop,
    HICON hIcon,
    int cxWidth,
    int cyWidth,
    UINT istepIfAniCur,
    HBRUSH hbrFlickerFreeDraw,
    UINT diFlags
);
HICON DuplicateIcon(          HINSTANCE hInst,
    HICON hIcon
);
HICON ExtractAssociatedIcon(          HINSTANCE hInst,
    LPTSTR lpIconPath,
    LPWORD lpiIcon
);
HICON ExtractIcon(          HINSTANCE hInst,
    LPCTSTR lpszExeFileName,
    UINT nIconIndex
);

UINT ExtractIconEx(          LPCTSTR lpszFile,
    int nIconIndex,
    HICON *phiconLarge,
    HICON *phiconSmall,
    UINT nIcons
);
BOOL GetIconInfo(          HICON hIcon,
    PICONINFO piconinfo
);
BOOL GetIconInfoEx(          HICON hIcon,
    PICONINFOEX piconinfoex
);
HICON LoadIcon(          HINSTANCE hInstance,
    LPCTSTR lpIconName
);

UINT PrivateExtractIcons(          LPCTSTR lpszFile,
    int nIconIndex,
    int cxIcon,
    int cyIcon,
    HICON *phicon,
    UINT *piconid,
    UINT nIcons,
    UINT flags
);

//@分组}
*/

//---------------网络winsock--------------------------------------------------------------------------------------
/*@声明
//@分组{   网络winsock

SOCKET WINAPI accept(
  SOCKET   s,
  sockaddr *addr,
  int      *addrlen
);
BOOL AcceptEx(
  SOCKET       sListenSocket,
  SOCKET       sAcceptSocket,
  PVOID        lpOutputBuffer,
  DWORD        dwReceiveDataLength,
  DWORD        dwLocalAddressLength,
  DWORD        dwRemoteAddressLength,
  LPDWORD      lpdwBytesReceived,
  LPOVERLAPPED lpOverlapped
);
int bind(
  SOCKET         s,
  const sockaddr *addr,
  int            namelen
);
int closesocket(
  SOCKET s
);
int WINAPI connect(
  SOCKET         s,
  const sockaddr *name,
  int            namelen
);
BOOL WINAPI ConnectEx(
  __in          SOCKET s,
  __in          const sockaddr* name,
  __in          int namelen,
  __in_opt      PVOID lpSendBuffer,
  __in          DWORD dwSendDataLength,
  __out         LPDWORD lpdwBytesSent,
  __in          LPOVERLAPPED lpOverlapped
);

BOOL DisconnectEx(
  _In_ SOCKET       hSocket,
  _In_ LPOVERLAPPED lpOverlapped,
  _In_ DWORD        dwFlags,
  _In_ DWORD        reserved
);
INT EnumProtocols(
  LPINT lpiProtocols,
  LPVOID lpProtocolBuffer,
  LPDWORD lpdwBufferLength
);
INT GetAddressByName(
  DWORD dwNameSpace,
  LPGUID lpServiceType,
  LPTSTR lpServiceName,
  LPINT lpiProtocols,
  DWORD dwResolution,
  LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
  LPVOID lpCsaddrBuffer,
  LPDWORD lpdwBufferLength,
  LPTSTR lpAliasBuffer,
  LPDWORD lpdwAliasBufferLength
);

void freeaddrinfo(
  __in          addrinfo* ai
);
void WINAPI FreeAddrInfoEx(
  __in          PADDRINFOEX pAddrInfo
);
void WINAPI FreeAddrInfo(
  __in          PADDRINFOW pAddrInfo
);
int WINAPI GetAddrInfo(
  __in          PCWSTR pNodeName,
  __in          PCWSTR pServiceName,
  __in          const ADDRINFOW* pHints,
  __out         PADDRINFOW* ppResult
);
int WINAPI GetAddrInfoEx(
  __in          PCTSTR pName,
  __in          PCTSTR pServiceName,
  __in          DWORD dwNameSpace,
  __in_opt      LPGUID lpNspId,
  __in_opt      const ADDRINFOEX* pHints,
  __out         PADDRINFOEX* ppResult,
  __in          timeval* timeout,
  __in_opt      LPOVERLAPPED lpOverlapped,
  __in_opt      LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine,
  __out_opt     LPHANDLE lpNameHandle
);
hostent*  gethostbyaddr(
  __in          const char* addr,
  __in          int len,
  __in          int type
);

hostent*  gethostbyname(
  __in          const char* name
);

int gethostname(
  __out         char* name,
  __in          int namelen
);

INT GetNameByType(
  LPGUID lpServiceType,
  LPTSTR lpServiceName,
  DWORD dwNameLength
);

int WINAPI GetNameInfo(
  __in          const SOCKADDR* pSockaddr,
  __in          socklen_t SockaddrLength,
  __out         PWCHAR pNodeBuffer,
  __in          DWORD NodeBufferSize,
  __out         PWCHAR pServiceBuffer,
  __in          DWORD ServiceBufferSize,
  __in          INT Flags
);
int getpeername(
  __in          SOCKET s,
  __out         sockaddr* name,
  __in_out      int* namelen
);

PROTOENT* getprotobyname(
  __in          const char* name
);
int getsockname(
  __in          SOCKET s,
  __out         sockaddr* name,
  __in_out      int* namelen
);
int getsockopt(
  __in          SOCKET s,
  __in          int level,
  __in          int optname,
  __out         char* optval,
  __in_out      int* optlen
);
u_long htonl(
  __in          u_long hostlong
);
u_short htons(
  __in          u_short hostshort
);
unsigned long inet_addr(
  __in          const char* cp
);
char* inet_ntoa(
  __in           in_addr in
);
int listen(
  __in          SOCKET s,
  __in          int backlog
);
int recv(
  __in          SOCKET s,
  __out         char* buf,
  __in          int len,
  __in          int flags
);
int recvfrom(
  __in          SOCKET s,
  __out         char* buf,
  __in          int len,
  __in          int flags,
  __out         sockaddr* from,
  __in_out      int* fromlen
);
int select(
  __in          int nfds,
  __in_out      fd_set* readfds,
  __in_out      fd_set* writefds,
  __in_out      fd_set* exceptfds,
  __in          const timeval* timeout
);
int send(
  __in          SOCKET s,
  __in          const char* buf,
  __in          int len,
  __in          int flags
);
int sendto(
  __in          SOCKET s,
  __in          const char* buf,
  __in          int len,
  __in          int flags,
  __in          const sockaddr* to,
  __in          int tolen
);
int setsockopt(
  __in          SOCKET s,
  __in          int level,
  __in          int optname,
  __in          const char* optval,
  __in          int optlen
);
int shutdown(
  __in          SOCKET s,
  __in          int how
);
SOCKET WINAPI socket(
  __in          int af,
  __in          int type,
  __in          int protocol
);
int WSAStartup(
  __in          WORD wVersionRequested,
  __out         LPWSADATA lpWSAData
);
int WSAGetLastError(void);
int WSACleanup(void);

//@分组}
*/


//---------------内核对象--------------------------------------------------------------------------------------
/*@声明

//-----------临界区-----------------------------------------------
//@分组{   临界区

void InitializeCriticalSection(
  LPCRITICAL_SECTION lpCriticalSection
);
void EnterCriticalSection(
  LPCRITICAL_SECTION lpCriticalSection
);
void LeaveCriticalSection(
  LPCRITICAL_SECTION lpCriticalSection
);
BOOL TryEnterCriticalSection(
  LPCRITICAL_SECTION lpCriticalSection
);
void DeleteCriticalSection(
  LPCRITICAL_SECTION lpCriticalSection
);
//@分组}

//----------互斥对象--------------------------

//@分组{   互斥对象
HANDLE CreateMutexA(
  LPSECURITY_ATTRIBUTES lpMutexAttributes,
  BOOL                  bInitialOwner,
  LPCSTR                lpName
);

HANDLE CreateMutexExA(
  LPSECURITY_ATTRIBUTES lpMutexAttributes,
  LPCSTR                lpName,
  DWORD                 dwFlags,
  DWORD                 dwDesiredAccess
);
HANDLE OpenMutex(
  DWORD   dwDesiredAccess,
  BOOL    bInheritHandle,
  LPCWSTR lpName
);
BOOL ReleaseMutex(
  HANDLE hMutex
);
//@分组}

//----------等待操作----------------------------------

//@分组{   等待操作
BOOL RegisterWaitForSingleObject(
  PHANDLE             phNewWaitObject,
  HANDLE              hObject,
  WAITORTIMERCALLBACK Callback,
  PVOID               Context,
  ULONG               dwMilliseconds,
  ULONG               dwFlags
);

DWORD MsgWaitForMultipleObjects(
  DWORD        nCount,
  const HANDLE *pHandles,
  BOOL         fWaitAll,
  DWORD        dwMilliseconds,
  DWORD        dwWakeMask
);

DWORD MsgWaitForMultipleObjectsEx(
  DWORD        nCount,
  const HANDLE *pHandles,
  DWORD        dwMilliseconds,
  DWORD        dwWakeMask,
  DWORD        dwFlags
);

DWORD SignalObjectAndWait(
  HANDLE hObjectToSignal,
  HANDLE hObjectToWaitOn,
  DWORD  dwMilliseconds,
  BOOL   bAlertable
);
BOOL UnregisterWait(
  HANDLE WaitHandle
);
BOOL WINAPI UnregisterWaitEx(
  _In_     HANDLE WaitHandle,
  _In_opt_ HANDLE CompletionEvent
);
DWORD WaitForMultipleObjects(
  DWORD        nCount,
  const HANDLE *lpHandles,
  BOOL         bWaitAll,
  DWORD        dwMilliseconds
);
DWORD WaitForSingleObjectEx(
  HANDLE hHandle,
  DWORD  dwMilliseconds,
  BOOL   bAlertable
);
BOOL WaitOnAddress(
 VOID *Address,
  PVOID         CompareAddress,
  SIZE_T        AddressSize,
  DWORD         dwMilliseconds
);

void WakeByAddressAll(
  PVOID Address
);
void WakeByAddressSingle(
  PVOID Address
);
//@分组}

//----信号量功能------------------------------------

//@分组{  信号量功能
HANDLE CreateSemaphoreA(
  LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  LONG                  lInitialCount,
  LONG                  lMaximumCount,
  LPCSTR                lpName
);
HANDLE CreateSemaphoreExA(
  LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  LONG                  lInitialCount,
  LONG                  lMaximumCount,
  LPCSTR                lpName,
  DWORD                 dwFlags,
  DWORD                 dwDesiredAccess
);
HANDLE OpenSemaphore(
  DWORD   dwDesiredAccess,
  BOOL    bInheritHandle,
  LPCWSTR lpName
);

BOOL ReleaseSemaphore(
  HANDLE hSemaphore,
  LONG   lReleaseCount,
  LPLONG lpPreviousCount
);
//@分组}

//----------事件对象-------------------------------------------------

//@分组{  事件对象
HANDLE CreateEvent(
  LPSECURITY_ATTRIBUTES lpEventAttributes,
  BOOL                  bManualReset,
  BOOL                  bInitialState,
  LPCWSTR               lpName
);

HANDLE CreateEventEx(
  LPSECURITY_ATTRIBUTES lpEventAttributes,
  LPCWSTR               lpName,
  DWORD                 dwFlags,
  DWORD                 dwDesiredAccess
);

HANDLE WINAPI OpenEvent(
  __in          DWORD dwDesiredAccess,
  __in          BOOL bInheritHandle,
  __in          LPCTSTR lpName
);

BOOL PulseEvent(
  HANDLE hEvent
);
BOOL ResetEvent(
  HANDLE hEvent
);
BOOL SetEvent(
  HANDLE hEvent
);
//@分组}

//-------------通信管道---------------------------

//@分组{  通信管道
BOOL CreatePipe(
  PHANDLE               hReadPipe,
  PHANDLE               hWritePipe,
  LPSECURITY_ATTRIBUTES lpPipeAttributes,
  DWORD                 nSize
);
BOOL WINAPI CallNamedPipe(
  __in          LPCTSTR lpNamedPipeName,
  __in          LPVOID lpInBuffer,
  __in          DWORD nInBufferSize,
  __out         LPVOID lpOutBuffer,
  __in          DWORD nOutBufferSize,
  __out         LPDWORD lpBytesRead,
  __in          DWORD nTimeOut
);

BOOL ConnectNamedPipe(
  HANDLE       hNamedPipe,
  LPOVERLAPPED lpOverlapped
);
HANDLE WINAPI CreateNamedPipe(
  __in          LPCTSTR lpName,
  __in          DWORD dwOpenMode,
  __in          DWORD dwPipeMode,
  __in          DWORD nMaxInstances,
  __in          DWORD nOutBufferSize,
  __in          DWORD nInBufferSize,
  __in          DWORD nDefaultTimeOut,
  __in          LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

BOOL DisconnectNamedPipe(
  HANDLE hNamedPipe
);
BOOL WINAPI GetNamedPipeClientComputerName(
  __in          HANDLE Pipe,
  __out         LPTSTR ClientComputerName,
  __in          ULONG ClientComputerNameLength
);

BOOL GetNamedPipeClientProcessId(
  HANDLE Pipe,
  PULONG ClientProcessId
);
BOOL GetNamedPipeClientSessionId(
  HANDLE Pipe,
  PULONG ClientSessionId
);
BOOL WINAPI GetNamedPipeHandleState(
  __in          HANDLE hNamedPipe,
  __out         LPDWORD lpState,
  __out         LPDWORD lpCurInstances,
  __out         LPDWORD lpMaxCollectionCount,
  __out         LPDWORD lpCollectDataTimeout,
  __out         LPTSTR lpUserName,
  __in          DWORD nMaxUserNameSize
);

BOOL GetNamedPipeInfo(
  HANDLE  hNamedPipe,
  LPDWORD lpFlags,
  LPDWORD lpOutBufferSize,
  LPDWORD lpInBufferSize,
  LPDWORD lpMaxInstances
);
BOOL GetNamedPipeServerProcessId(
  HANDLE Pipe,
  PULONG ServerProcessId
);
BOOL GetNamedPipeServerSessionId(
  HANDLE Pipe,
  PULONG ServerSessionId
);
BOOL ImpersonateNamedPipeClient(
  HANDLE hNamedPipe
);
BOOL PeekNamedPipe(
  HANDLE  hNamedPipe,
  LPVOID  lpBuffer,
  DWORD   nBufferSize,
  LPDWORD lpBytesRead,
  LPDWORD lpTotalBytesAvail,
  LPDWORD lpBytesLeftThisMessage
);
BOOL WINAPI WaitNamedPipe(
  __in          LPCTSTR lpNamedPipeName,
  __in          DWORD nTimeOut
);

BOOL SetNamedPipeHandleState(
  HANDLE  hNamedPipe,
  LPDWORD lpMode,
  LPDWORD lpMaxCollectionCount,
  LPDWORD lpCollectDataTimeout
);

BOOL TransactNamedPipe(
  HANDLE       hNamedPipe,
  LPVOID       lpInBuffer,
  DWORD        nInBufferSize,
  LPVOID       lpOutBuffer,
  DWORD        nOutBufferSize,
  LPDWORD      lpBytesRead,
  LPOVERLAPPED lpOverlapped
);

//@分组}
*/

//------------进程线程-------------------------------------------------------------------------
/*@声明
//@分组{  进程线程

BOOL CreateProcess(
  LPCWSTR               lpApplicationName,
  LPWSTR                lpCommandLine,
  LPSECURITY_ATTRIBUTES lpProcessAttributes,
  LPSECURITY_ATTRIBUTES lpThreadAttributes,
  BOOL                  bInheritHandles,
  DWORD                 dwCreationFlags,
  LPVOID                lpEnvironment,
  LPCWSTR               lpCurrentDirectory,
  LPSTARTUPINFOW        lpStartupInfo,
  LPPROCESS_INFORMATION lpProcessInformation
);

HANDLE CreateRemoteThread(
  HANDLE                 hProcess,
  LPSECURITY_ATTRIBUTES  lpThreadAttributes,
  SIZE_T                 dwStackSize,
  LPTHREAD_START_ROUTINE lpStartAddress,
  LPVOID                 lpParameter,
  DWORD                  dwCreationFlags,
  LPDWORD                lpThreadId
);
HANDLE CreateRemoteThreadEx(
  HANDLE                       hProcess,
  LPSECURITY_ATTRIBUTES        lpThreadAttributes,
  SIZE_T                       dwStackSize,
  LPTHREAD_START_ROUTINE       lpStartAddress,
  LPVOID                       lpParameter,
  DWORD                        dwCreationFlags,
  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
  LPDWORD                      lpThreadId
);
HANDLE CreateThread(
  LPSECURITY_ATTRIBUTES   lpThreadAttributes,
  SIZE_T                  dwStackSize,
  LPTHREAD_START_ROUTINE  lpStartAddress,
  LPVOID lpParameter,
  DWORD                   dwCreationFlags,
  LPDWORD                 lpThreadId
);
void ExitProcess(
  UINT uExitCode
);
void ExitThread(
  DWORD dwExitCode
);
HANDLE GetCurrentProcess();
DWORD GetCurrentProcessId();
DWORD GetCurrentProcessorNumber();
void GetCurrentProcessorNumberEx(
  PPROCESSOR_NUMBER ProcNumber
);

HANDLE GetCurrentProcessToken();
BOOL TerminateThread(
  HANDLE hThread,
  DWORD  dwExitCode
);

HANDLE GetCurrentThread();

DWORD GetCurrentThreadId();
HANDLE GetCurrentThreadToken();

BOOL GetExitCodeProcess(
  HANDLE  hProcess,
  LPDWORD lpExitCode
);

BOOL GetExitCodeThread(
  HANDLE  hThread,
  LPDWORD lpExitCode
);
DWORD GetPriorityClass(
  HANDLE hProcess
);
BOOL GetProcessHandleCount(
  HANDLE hProcess,
  PDWORD pdwHandleCount
);
DWORD GetProcessId(
  HANDLE Process
);
DWORD GetProcessIdOfThread(
  HANDLE Thread
);
BOOL GetProcessInformation(
  HANDLE                    hProcess,
  PROCESS_INFORMATION_CLASS ProcessInformationClass,
  LPVOID                    ProcessInformation,
  DWORD                     ProcessInformationSize
);
BOOL GetProcessShutdownParameters(
  LPDWORD lpdwLevel,
  LPDWORD lpdwFlags
);
BOOL GetProcessTimes(
  HANDLE     hProcess,
  LPFILETIME lpCreationTime,
  LPFILETIME lpExitTime,
  LPFILETIME lpKernelTime,
  LPFILETIME lpUserTime
);

DWORD GetProcessVersion(
  DWORD ProcessId
);
void GetStartupInfo(
  LPSTARTUPINFOW lpStartupInfo
);
BOOL GetSystemTimes(
  PFILETIME lpIdleTime,
  PFILETIME lpKernelTime,
  PFILETIME lpUserTime
);

BOOL GetThreadContext(
  HANDLE    hThread,
  LPCONTEXT lpContext
);

HRESULT GetThreadDescription(
  HANDLE hThread,
  PWSTR  *ppszThreadDescription
);
DWORD GetThreadId(
  HANDLE Thread
);

BOOL GetThreadInformation(
  HANDLE                   hThread,
  THREAD_INFORMATION_CLASS ThreadInformationClass,
  LPVOID                   ThreadInformation,
  DWORD                    ThreadInformationSize
);

BOOL GetThreadTimes(
  HANDLE     hThread,
  LPFILETIME lpCreationTime,
  LPFILETIME lpExitTime,
  LPFILETIME lpKernelTime,
  LPFILETIME lpUserTime
);
HANDLE OpenProcess(
  DWORD dwDesiredAccess,
  BOOL  bInheritHandle,
  DWORD dwProcessId
);

BOOL OpenProcessToken(
  HANDLE  ProcessHandle,
  DWORD   DesiredAccess,
  PHANDLE TokenHandle
);

HANDLE OpenThread(
  DWORD dwDesiredAccess,
  BOOL  bInheritHandle,
  DWORD dwThreadId
);
BOOL OpenThreadToken(
  HANDLE  ThreadHandle,
  DWORD   DesiredAccess,
  BOOL    OpenAsSelf,
  PHANDLE TokenHandle
);

DWORD ResumeThread(
  HANDLE hThread
);

BOOL SetThreadContext(
  HANDLE        hThread,
  const CONTEXT *lpContext
);

HRESULT SetThreadDescription(
  HANDLE hThread,
  PCWSTR lpThreadDescription
);

BOOL SetThreadToken(
  PHANDLE Thread,
  HANDLE  Token
);

BOOL SetThreadInformation(
  HANDLE                   hThread,
  THREAD_INFORMATION_CLASS ThreadInformationClass,
  LPVOID                   ThreadInformation,
  DWORD                    ThreadInformationSize
);

DWORD SuspendThread(
  HANDLE hThread
);

BOOL SwitchToThread();
BOOL TerminateProcess(
  HANDLE hProcess,
  UINT   uExitCode
);

//@分组}
*/


/*@声明
//@分组{   其他

DWORD WINAPI GetLastError();

//@分组}
*/